package com.bjtu.ptsite.model;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 *
 * @author Zehao Wang, Junjie Zhang, Yutao Wei
 *
 */
@TableName("bt_peer_info")
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class PeerMessage {

    /**
     * 主键
     */
    private Long id;
    /**
     * torrent文件infoHash
     */
    private String infoHash;
    /**
     * bt客户端识别身份
     */
    private String peerId;
    /**
     * bt客户端ip
     */
    private String ip;
    /**
     * bt客户端端口
     */
    private Integer port;
    /**
     * 上传量
     */
    private Long uploaded;
    /**
     * 下载量
     */
    private Long downloaded;

    /**
     * 剩余未下载的字节数
     */
    private Long peerLeft;
    /**
     * 是否完成下载
     */
    private Boolean isCompleted;
    /**
     * 最后一次请求时间
     */
    private LocalDateTime lastAnnounceTime;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    private String event;

    private String passkey;

    private boolean isSeeder;

}
